package com.tarena.lbs.coupon.dao.repository.impl;

import com.tarena.lbs.coupon.dao.mapper.CouponMapper;
import com.tarena.lbs.coupon.dao.repository.StockRepository;
import com.tarena.lbs.coupon.pojo.po.CouponPO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Slf4j
@Service
public class StockRepositoryImpl implements StockRepository {
    @Autowired
    private CouponMapper couponMapper;
    @Override
    public CouponPO countStock(Integer couponId) {
        return couponMapper.selectById(couponId);
    }

    @Override
    public int updateStock(Integer id) {
        return couponMapper.update(id);
    }
}
